From: Jonas Dreßler Date: Thu, 14 Nov 2019 17:51:01 +0000 (+0100) Subject: polkitAgent: Only reset UI on session resets while opened X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~411 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3a7228cf2fbf1e92e85d366683e94a57c396f312;p=gnome-shell.git polkitAgent: Only reset UI on session resets while opened Since `_destroySession()` is not only called before we try to initiate a new authentication session with Polkit, but also when the dialog is closed, it's currently possible that key focus is grabbed by the close button after the dialog was dismissed and hidden. This is causing a bug where after dismissing one of multiple queued dialogs, key focus goes away and keyboard navigation with the new dialog is impossible. Fix this by only resetting the UI of the dialog if the dialog is still opened/visible at that point. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/828 --- diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index 9fa3dff5d..1817aac05 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -319,6 +319,9 @@ var AuthenticationDialog = GObject.registerClass({ } let resetDialog = () => { + if (this.state != ModalDialog.State.OPENED) + return; + this._passwordBox.hide(); this._cancelButton.grab_key_focus(); this._okButton.reactive = false;